package com.lottery.ruok.lottrey.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.view.ViewGroup;

import com.lottery.ruok.lottrey.fragment.BaseFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by weixiaopan on 2018/1/5.
 */

public class CommonFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> fragments;

    public CommonFragmentPagerAdapter(FragmentManager fm, List<BaseFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }

}
